	$(document).ready(function()
	{
		$("#preview").click(function()
		{
			var p = $("textarea#_portal").val();
			var co = $("textarea#_country").val();
			var ci = $("textarea#_city").val();

			var val = "\n";
			if(p == "")
			{
				if(ci == "" && co != "") str = co;
				else if(ci != "" && co == "") str = ci;
				else if(ci != "" && co != "") str = co + val + ci;
			}
			else if(co == "")
			{
				if(ci == "") str = p;
				else if(ci != "") str = p + val + ci;
			}
			else if(co != "")
			{
				if(ci == "") str = p + val + co;
				else if(ci != "") str = p + val + co + val + ci;
			}
			$("#result").val("");
			$("#result").val($("#result").val() + str);
		});
	})